package com.ruoyi.project.museum.controller;

import com.alibaba.fastjson.JSON;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.project.museum.domain.MyTest;
import com.ruoyi.project.museum.service.MyTestService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @author G. Seinfeld
 * @since 2021/02/25
 */
@Controller
@RequestMapping("lingpao/test")
public class MyTestController extends BaseController {

    @Resource
    MyTestService myTestService;

    @GetMapping("/get/{id}")
    @ResponseBody
    public String get(@PathVariable Long id) {
        final MyTest myTest = myTestService.getById(id);
        return JSON.toJSONString(myTest);
    }
}
